#include <stdio.h>
#include <sys/types.h>

static char *uint2buff(char *buff,u_int32_t n)
{
  u_int8_t *p = (u_int8_t*)buff;
  *p++ = (n >> 24) & 0xFF;
  printf("%x",*(--p));
  *p++ = (n >> 16) & 0xFF;
  printf("%x",*(--p));
  *p++ = (n >> 8) & 0xFF;
  printf("%x",*(--p));
  *p++ = n & 0xFF;
  printf("%x",*(--p));
  return (char*)p; 
}

int main(int argc ,char argv[]){
    char x1,x2;
    short n = 0x1122;
    
    x1 = ((char*)&n)[0];
    x2 = ((char*)&n)[1];
    if(x1 == 0x11){
      printf("is big %x\n",x1);
    }else{
      printf("is littl %x\n",x1);
    }


    //printf(":%x\n",(n>>24));
    //printf(":%x\n",(n>>16));
    printf(":%x\n",(n>>8));
    printf(":%x\n",(n&0xFF));

    char buff[4] = {'\0'};
   // uint2buff(buff,n); 
    return 0;
}
